<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<p:dialog xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" 
	modal="true" width="500" height="300" resizable="false" 
	widgetVar="dialogAddPais" id="dialogFormPais" closable="false"
	appendToBody="true">
	
	<f:facet name="header">
		<h:outputText value="Manter País" />
	</f:facet>
	
	<h:form id="formAddPais" prependId="false" >
		<p:messages globalOnly="false"/>
		<h:panelGrid columns="1" style="padding:5px;">
			<h:outputText value="Código:" />
			<h:inputText value="#{paisBean.currentPais.id}" style="width:100px;" ></h:inputText>
		</h:panelGrid>
		
		<h:panelGrid columns="1" style="padding:5px;">
			<h:outputText value="País:" />
			<h:inputText value="#{paisBean.currentPais.pais}" 
				style="width:210px;" required="true"
				requiredMessage="Nome do país é  obrigatório."/>
		</h:panelGrid>
		
		<h:panelGrid columns="2" style="padding:5px;">
			<h:outputText value="Sigla:" />
			<h:outputText value="DDI:" />
			
			<h:inputText value="#{paisBean.currentPais.sigla}" style="width:100px;"/>
			<h:inputText value="#{paisBean.currentPais.ddi}" style="width:100px;"/>
		</h:panelGrid>
		
		<div id="popup-buttons" style="padding-bottom: 10px;padding-right: 15px; padding-top: 10px; text-align: right;">
			<p:commandButton value="Salvar" 
				style="height:28px;" actionListener="#{paisBean.save}"
				process="@this formAddPais" update="formAddPais"/>
			<p:commandButton value="Limpar" style="height:28px;"/>
			<p:commandButton value="Cancelar" style="height:28px;" onclick="dialogAddPais.hide();"/>
		</div>
	</h:form>
</p:dialog>